import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "./utils/axios";
import "./vant";
Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");

router.beforeEach((to, from, next) => {
  if (to.path == "/todolist") {
    const res = JSON.parse(localStorage.getItem("lgc"));
    console.log(res);
    if (res) {
      next();
    } else {
      next("/user");
    }
  } else {
    next();
  }
});
